<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class m_tindak_lanjut_model extends arfaModel
{
    function __construct() {
        parent::__construct();
		$this->table_name	= "tindak_lanjut";
		$this->primary_key	= "kd_tindak_lanjut";
		$this->order_by		= "kd_tindak_lanjut ASC";
    }

    public function get_jumlah($tgl_awal,$tgl_akhir,$sord) {
    	$this->db->select("*");
    	$this->db->from($this->table_name);
    	$this->db->join("master_pertanyaan", "tindak_lanjut.ID_PERTANYAAN = master_pertanyaan.ID_PERTANYAAN");
    	$this->db->where($sord." >=", $tgl_awal);
    	$this->db->where($sord." <=", $tgl_akhir);
        $this->db->group_by($sord);
    	$query = $this->db->get();

    	return $query->result_array();
    }

    public function get_data_tindak_lanjut($sord,$tanggal) {
        $this->db->select("*");
        $this->db->from($this->table_name);
        $this->db->join("master_pertanyaan", "tindak_lanjut.ID_PERTANYAAN = master_pertanyaan.ID_PERTANYAAN");
        $this->db->like($sord, $tanggal);
        $query = $this->db->get();

        return $query->result_array();
    }

}